#分离通道
import cv2
# import numpy as np
img=cv2.imread('lena.jpg')


#分离通道
blue=img[:,:,1]
green=img[:,:,0]
red=img[:,:,2]

px = img.item(0,0,2) # red
print (px)
img.itemset((0,0,2),100)
print (img.item(0,0,2))

im3=cv2.merge((blue,green,red))
cv2.imshow('im',im3)
cv2.waitKey(0)

